// ts-nocheck
import React, { useMemo } from "react";
import { DataSet, Form, TextField } from "choerodon-ui/pro";

export default function Test() {
  const formDs = useMemo(() => {
    return new DataSet({
      data: [
        {
          name: "ming",
          age: 12,
          sex: "male",
          height: 1.7,
          weight: 80,
        },
        {
          name: "ming",
          age: 12,
          sex: "male",
          height: 1.7,
          weight: 80,
        },
        {
          name: "ming",
          age: 12,
          sex: "male",
          height: 1.7,
          weight: 80,
        },
        {
          name: "ming",
          age: 12,
          sex: "male",
          height: 1.7,
          weight: 80,
        },
        {
          name: "ming",
          age: 12,
          sex: "male",
          height: 1.7,
          weight: 80,
        },
      ],
      fields: [
        {
          name: "name",
          label: "名称",
        },
        {
          name: "age",
          label: "年龄",
        },
        {
          name: "sex",
          label: "性别",
        },
        {
          name: "height",
          label: "身高",
        },
        {
          name: "weight",
          label: "体重",
        },
      ],
      queryFields: [
        {
          name: "name",
          label: "名称",
        },
      ],
    });
  }, []);

  return (
    <>
      {/* @ts-ignore */}
      <Form dataSet={formDs} columns={3}>
        {/* @ts-ignore */}
        <TextField name='name' />
        {/* @ts-ignore */}
        <TextField name='age' />
        {/* @ts-ignore */}
        <TextField name='sex' />
        {/* @ts-ignore */}
        <TextField name='height' />
        {/* @ts-ignore */}
        <TextField name='weight' />
      </Form>
    </>
  );
}
